function projectCtrl($scope, $rootScope, $modal) {
    $scope.readProjectList = function () {
        getProjectList($scope);
    }

    $scope.getProjectDetail = function(projectId){
        getProjectDetail($scope,projectId);
    }
}
function getProjectList($scope) {
    $.ajax({
        url: '/project/get_project_list',
        success: function (data) {
            console.log(data);
            if (data.success) {
                $scope.$apply(function () {
                    $scope.projectList = data.data;
                });
            }
        },
        error: function (error) {
            console.log(error);
        }
    });
}

function getProjectDetail($scope,projectId){
    $.ajax({
        url: '/project/get_project_detail',
        data:{
            'projectId':projectId
        },
        success: function (data) {
            console.log(data);
            if (data.success) {
                $scope.$apply(function () {
                    $scope.projectList = data.data;
                });
            }
        },
        error: function (error) {
            console.log(error);
        }
    });
}
angular
    .module('inspinia')
    .controller('projectCtrl', projectCtrl)